package com.huawang.mdesign.model.service.util.reqif;

import com.huawang.mdesign.model.service.util.reqif.ref.AttributeDefinitionXHTMLRef;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamOmitField;
import lombok.Getter;
import lombok.Setter;

/**
 * An attribute value with XHTML contents.
 *
 * @author xdl
 * @since 2023-04-04
 */
@Getter
@Setter
@XStreamAlias(ReqIFConstants.ATTRIBUTE_VALUE_XHTML)
public class AttributeValueXHTML extends AttributeValue {

    /**
     * Set to true if the attribute value is a simplified representation of the original value.
     */
    @XStreamAlias(ReqIFConstants.IS_SIMPLIFIED)
    @XStreamAsAttribute
    private Boolean isSimplified;

    /**
     * Linkage to the owned XhtmlContent
     */
    @XStreamAlias(ReqIFConstants.VALUE)
    private XhtmlContent theValue;

    /**
     * Linkage to the original attribute value that has been saved if isSimplified is true.
     */
    @XStreamAlias(ReqIFConstants.ORIGINAL_VALUE)
    private XhtmlContent theOriginalValue;

    /**
     * Reference to the value definition.
     */
    @XStreamOmitField
    private AttributeDefinitionXHTML definition;

    @XStreamAlias(ReqIFConstants.DEFINITION)
    private AttributeDefinitionXHTMLRef definitionRef;

    /**
     * Back linkage of the owning attribute definition
     */
    @XStreamOmitField
    private AttributeDefinitionXHTML owningDefinition;
}
